class Dog {
    // 属性-》成员变量
    public String name;
    public int age;

    //行为 -》 成员方法
    public void eat() {
        int count = 0;//局部变量
                    //局部变量是当你在调用方法时,才会在栈帧里给count变量开辟一块内存
        //System.out.println(count);
        System.out.println(name+"正在吃饭！");
    }
    public void barks() {
        System.out.println(name+"正在旺旺！");
    }
}
public class Test1 {
    public static void main(String[] args) {
        Dog dog1 = new Dog();
        dog1.name = "haha";
        dog1.age = 12;
        System.out.println(dog1.name);
        System.out.println(dog1.age);

        Dog dog2 = new Dog();
        dog2.name = "haha2";
        dog2.age = 122;
        System.out.println(dog2.name);
        System.out.println(dog2.age);
    }

    public static void main1(String[] args) {
        //实例化对象
        Dog dog1 = new Dog();
        Dog dog2 = new Dog();
        Dog dog3 = new Dog();
        Dog dog4 = new Dog();
        Dog dog5 = new Dog();
    }
}
